
Reguile
You would already have the identity, assuming identity is a "learned pattern of self and ability to recognize when an action is performed by you", so you wouldn't need to create one. You'd use that pattern to produce new "thinking hardware" that matches that pattern frequently. It would not be the same person, but there is a concrete "memory of something" that is loosely based on the thing it was paired with.
The problem I have with that is that ego-death seems to change people's identities substantially. In some sense the totality of the memory of the brain exists and is stored and can be used to generate a new identity... but that identity isn't going to be the same identity. If you use the same data in exactly the same configuration and then reboot it in a new environment, it produces a different entity entirely.
So then - Which one of them is truly the "self"? That flawed encoded data, that changes every time you access it, or the actual emergent consciousness it produces? I'd say that the consciousness produced is the self of whatever system it's running on, but that memory, current sensation, and apparently a good amount of random luck since humans don't seem to always react the same way to anything anyway, is what it emerges from.